import { NavBar ,Icon} from "antd-mobile";
import React, { useReducer } from "react";
import { initState, reducer,actions } from "../Login/user";
export default function Mine(props) {
  const [state, dispatch] = useReducer(reducer, initState);
  return (
    <div>
      <NavBar mode="light" icon={<Icon type="left" />} onLeftClick={() => {props.history.go(-1)}}>
        我的
      </NavBar>
      <div>昵称：{state.info.nickname}</div>
      <button onClick={()=>{dispatch(actions.changeInfo({}));props.history.push("/login")}}>退出登录</button>
    </div>
  );
}
